home *** CD-ROM | disk | FTP | other *** search
/ SPACE 1 / SPACE - Library 1 - Volume 1.iso / misc~1 / 5 / osspascl / pfixi.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1985-11-19  |  2.4 KB  |  96 lines

  1.  
  2. { FixPas - Patch bugs in PASGEM library and COMPILER.PRG; resultant version is
  3.     identical with 1.02.  Compile this patch program for TOS (but it doesn't
  4.     really matter much).  To perform the patch after compiling the program,
  5.       1.  Make a copy of your master disk (or your normal Pascal disk)
  6.       2.  Copy the FIXPAS.TOS program to this new disk.
  7.       3.  From either TOS or the Pascal manager, run the FIXPAS program.
  8.     The new disk now contains patched versions of the GEM library and the
  9.     Pascal Compiler. }
  10.  
  11. PROGRAM FixPas ;
  12.  
  13.   VAR
  14.     f : PACKED FILE OF byte ;
  15.     patch_pos : long_integer ;
  16.  
  17.   PROCEDURE patch( old_val, new_val : BYTE ) ;
  18.  
  19.     BEGIN
  20.       get( f, patch_pos ) ;
  21.       IF (f^ <> old_val) AND (f^ <> new_val) THEN
  22.         BEGIN
  23.           writeln( 'File doesn''t match: ', patch_pos:6:h, ' ', f^:2:h ) ;
  24.           halt
  25.         END ;
  26.       f^ := new_val ;
  27.       put( f, patch_pos ) ;
  28.       patch_pos := patch_pos + 1 ;
  29.     END ;
  30.  
  31.   PROCEDURE patch_pasgem ;
  32.  
  33.     BEGIN
  34.       reset( f, 'pasgem' ) ;
  35.  
  36.       patch_pos := 11587 {$2d43} ;
  37.       patch( $0e, $0c ) ;
  38.  
  39.       patch_pos := 11600 {$2d50} ;
  40.       patch( $5c, $58 ) ;
  41.  
  42.       patch_pos := 21902 {$558e} ;
  43.       patch( $54, $47 ) ;
  44.  
  45.       patch_pos := 37094 {$90e6} ;
  46.       patch( $48, $38 ) ;
  47.       patch( $c5, $05 ) ;
  48.       patch( $d1, $e5 ) ;
  49.       patch( $c5, $44 ) ;
  50.       patch( $d1, $d0 ) ;
  51.       patch( $c5, $c4 ) ;
  52.  
  53.       patch_pos := 37144 {$9118} ;
  54.       patch( $67, $60 ) ;
  55.     END ;
  56.  
  57.   PROCEDURE patch_compiler ;
  58.  
  59.     BEGIN
  60.       reset( f, 'compiler.prg' ) ;
  61.  
  62.       patch_pos := 106550 {$1a036} ;
  63.       patch( $46, $7c ) ;
  64.       patch( $61, $46 ) ;
  65.       patch( $74, $62 ) ;
  66.       patch( $61, $74 ) ;
  67.       patch( $6c, $61 ) ;
  68.       patch( $20, $6c ) ;
  69.       patch( $65, $20 ) ;
  70.       patch( $72, $65 ) ;
  71.  
  72.       patch_pos := 106559 {$1a03f} ;
  73.       patch( $6f, $72 ) ;
  74.       patch( $72, $6f ) ;
  75.       patch( $21, $72 ) ;
  76.       patch( $5d, $21 ) ;
  77.       patch( $5b, $20 ) ;
  78.       patch( $20, $5d ) ;
  79.       patch( $41, $5b ) ;
  80.       patch( $62, $41 ) ;
  81.       patch( $6f, $62 ) ;
  82.       patch( $72, $6f ) ;
  83.       patch( $74, $72 ) ;
  84.       patch( $20, $74 ) ;
  85.  
  86.       patch_pos := 122165 {$1dd35} ;
  87.       patch( $01, $02 ) ;
  88.     END ;
  89.  
  90.   BEGIN
  91.     patch_pasgem ;
  92.     patch_compiler ;
  93.   END.
  94.  
  95.  
  96. Press <CR> to continue: